﻿/**
 * Simplified Chinese translation
 * Build date: 2013-05-15
 */
Ext.onReady(function() {
    var cm = Ext.ClassManager,
        exists = Ext.Function.bind(cm.get, cm),
        parseCodes;

    if (Ext.Updater) {
        Ext.Updater.defaults.indicatorText = '<div class="loading-indicator">加載中...</div>';
    }

    Ext.define("Ext.locale.zh_CN.view.View", {
        override: "Ext.view.View",
        emptyText: ""
    });

    Ext.define("Ext.locale.zh_CN.grid.Panel", {
        override: "Ext.grid.Panel",
        ddText: "選擇了 {0} 行"
    });

    Ext.define("Ext.locale.zh_CN.TabPanelItem", {
        override: "Ext.TabPanelItem",
        closeText: "關閉此標籤"
    });

    Ext.define("Ext.locale.zh_CN.form.field.Base", {
        override: "Ext.form.field.Base",
        invalidText: "輸入值非法"
    });

    Ext.define("Ext.locale.zh_CN.view.AbstractView", {
        override: "Ext.view.AbstractView",
		loadingText: "讀取中..."
    });

    if (Ext.Date) {
        Ext.Date.monthNames = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"];
        Ext.Date.dayNames = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
        Ext.Date.formatCodes.a = "(this.getHours() < 12 ? '上午' : '下午')";
        Ext.Date.formatCodes.A = "(this.getHours() < 12 ? '上午' : '下午')";
        parseCodes = {
            g: 1,
            c: "if (/(上午)/i.test(results[{0}])) {\n"
                + "if (!h || h == 12) { h = 0; }\n"
                + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
            s: "(上午|下午)",
            calcAtEnd: true
        };
        Ext.Date.parseCodes.a = Ext.Date.parseCodes.A = parseCodes;
    }

    if (Ext.MessageBox) {
        Ext.MessageBox.buttonText = {
            ok: "確定",
            cancel: "取消",
            yes: "是",
            no: "否"
        };
    }

    if (exists('Ext.util.Format')) {
        Ext.apply(Ext.util.Format, {
            thousandSeparator: ",",
            decimalSeparator: ".",
            currencySign: "\u00a5",
            dateFormat: "y年m月d日"
        });
    }

    Ext.define("Ext.locale.zh_CN.picker.Date", {
        override: "Ext.picker.Date",
        todayText: "今天",
        minText: "日期必須大於最小允許日期",
        maxText: "日期必須小於最大允許日期",
        disabledDaysText: "",
        disabledDatesText: "",
        monthNames: Ext.Date.monthNames,
        dayNames: Ext.Date.dayNames,
        nextText: "下個月 (Ctrl+Right)",
        prevText: "上個月 (Ctrl+Left)",
        monthYearText: "選擇一個月(Control+Up/Down 來改變年份)",
        todayTip: "{0} (空格鍵選擇)",
        format: "y年m月d日",
        ariaTitle: "{0}",
        ariaTitleDateFormat: "Y\u5e74m\u6708d\u65e5",
        longDayFormat: "Y\u5e74m\u6708d\u65e5",
        monthYearFormat: "Y\u5e74m\u6708",
        getDayInitial: function (value) {
            return value.substr(-1, 1);
        }
    });

    Ext.define("Ext.locale.zh_CN.picker.Month", {
        override: "Ext.picker.Month",
        okText: "確定",
        cancelText: "取消"
    });

    Ext.define("Ext.locale.zh_CN.toolbar.Paging", {
        override: "Ext.PagingToolbar",
        beforePageText: "第",
        afterPageText: "頁,共 {0} 頁",
        firstText: "第一頁",
        prevText: "上一頁",
        nextText: "下一頁",
        lastText: "最後頁",
        refreshText: "刷新",
        displayMsg: "顯示 {0} - {1}條，共 {2} 條",
        emptyMsg: "沒有數據"
    });

    Ext.define("Ext.locale.zh_CN.form.field.Text", {
        override: "Ext.form.field.Text",
        minLengthText: "該輸入項的最小長度是{0} 個字符",
        maxLengthText: "該輸入項的最大長度是{0} 個字符",
        blankText: "該輸入項為必輸項",
        regexText: "",
        emptyText: null
    });

    Ext.define("Ext.locale.zh_CN.form.field.Number", {
        override: "Ext.form.field.Number",
        minText: "該輸入項的最小值是 {0}",
        maxText: "該輸入項的最大值是 {0}",
		negativeText : "該值不能為負值",
        nanText: "{0} 不是有效數值"
    });

    Ext.define("Ext.locale.zh_CN.form.field.Date", {
        override: "Ext.form.field.Date",
        disabledDaysText: "禁用",
        disabledDatesText: "禁用",
        minText: "該輸入項的日期必須在{0} 之後",
        maxText: "該輸入項的日期必須在{0} 之前",
        invalidText: "{0} 是無效的日期- 必須符合格式： {1}",
        format: "y年m月d日"
    });

    Ext.define("Ext.locale.zh_CN.form.field.ComboBox", {
        override: "Ext.form.field.ComboBox",
        valueNotFoundText: undefined
    }, function() {
        Ext.apply(Ext.form.field.ComboBox.prototype.defaultListConfig, {
            loadingText: "加載中..."
        });
    });

    if (exists('Ext.form.field.VTypes')) {
        Ext.apply(Ext.form.field.VTypes, {
            emailText: "該輸入項必須是電子郵件地址，格式如： 'user@example.com'",
            urlText: "該輸入項必須是URL地址，格式如： 'http:/' + '/www.example.com'",
            alphaText: "該輸入項只能包含半角字母和_",
            alphanumText: "該輸入項只能包含半角字母,數字和_"
        });
    }
    Ext.define("Ext.locale.zh_CN.form.field.HtmlEditor", {
        override: "Ext.form.field.HtmlEditor",
        createLinkText: "添加超級鏈接:"
    }, function() {
        Ext.apply(Ext.form.field.HtmlEditor.prototype, {
            buttonTips: {
                bold: {
                    title: "粗體 (Ctrl+B)",
                    text: "將選中的文字設置為粗體",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                italic: {
                    title: "斜體 (Ctrl+I)",
                    text: "將選中的文字設置為斜體",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                underline: {
                    title: "下劃線 (Ctrl+U)",
                    text: "給所選文字加下劃線",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                increasefontsize: {
                    title: "增大字體",
                    text: "增大字號",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                decreasefontsize: {
                    title: "縮小字體",
                    text: "減小字號",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                backcolor: {
                    title: "以不同顏色突出顯示文本",
                    text: "使文字看上去像是用熒光筆做了標記一樣",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                forecolor: {
                    title: "字體顏色",
                    text: "更改字體顏色",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                justifyleft: {
                    title: "左對齊",
                    text: "將文字左對齊",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                justifycenter: {
                    title: "居中",
                    text: "將文字居中對齊",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                justifyright: {
                    title: "右對齊",
                    text: "將文字右對齊",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                insertunorderedlist: {
                    title: "項目符號",
                    text: "開始創建項目符號列表",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                insertorderedlist: {
                    title: "編號",
                    text: "開始創建編號列表",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                createlink: {
                    title: "轉成超級鏈接",
                    text: "將所選文本轉換成超級鏈接",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                },
                sourceedit: {
                    title: "代碼視圖",
                    text: "以代碼的形式展現文本",
                    cls: Ext.baseCSSPrefix + 'html-editor-tip'
                }
            }
        });
    });

    Ext.define("Ext.locale.zh_CN.grid.header.Container", {
        override: "Ext.grid.header.Container",
        sortAscText: "正序",
        sortDescText: "倒序",
        lockText: "鎖定列",
        unlockText: "解除鎖定",
        columnsText: "列"
    });

    Ext.define("Ext.locale.zh_CN.grid.PropertyColumnModel", {
        override: "Ext.grid.PropertyColumnModel",
        nameText: "名稱",
        valueText: "值",
        dateFormat: "y年m月d日"
    });
	// ************************************************ ** original component ********************************************** **** //
	Ext.define("Ext.locale.zh_CN.form.RadioGroup", {
		override: "Ext.form.RadioGroup",
		blankText: "必須選擇其中的一項"
	});
	Ext.define("Ext.locale.zh_CN.form.CheckboxGroup", {
		override: "Ext.form.CheckboxGroup",
	    blankText: "必須選擇至少一項"
	});
	Ext.define("Ext.locale.zh_CN.grid.plugin.RowEditor", {
		override : 'Ext.grid.plugin.RowEditing',
		saveBtnText: "更新",
		cancelBtnText: "取消",
	    errorsText: "錯誤",
	    dirtyText: "你需要提交或取消變更。"
	});
	// ************************************************ ** extend component ********************************************** **** //
	Ext.define("Ext.locale.zh_CN.grid.Panel", {
		override: "Ext.grid.Panel",
		emptyText: "暫無數據"
	});
	Ext.define("Deppon.locale.zh_CN.form.field.RangeDateField", {
		override: "Deppon.form.field.RangeDateField",
		rangeFlag: "&nbsp;&nbsp;至&nbsp;&nbsp;"
	});
	Ext.define("Deppon.locale.zh_CN.form.field.DateTimeField", {
		override: "Deppon.form.field.DateTimeField",
		minText: "該輸入項的日期必須在{0} 之後",
		maxText: "該輸入項的日期必須在{0} 之前"
	});
	Ext.define("Deppon.locale.zh_CN.paging.SimplePaging", {
		override: "Deppon.paging.SimplePaging",
		displayMsg: "共 {0} 頁",
		prevText: "上一頁",
		nextText: "下一頁"
	});
	Ext.define("Deppon.locale.zh_CN.paging.StandardPaging", {
		override: "Deppon.paging.StandardPaging",
		displayMsg: "共 {0} 頁",
		displayExtralMsg: "共 {0} 頁, {1} 條記錄",
		emptyMsg: "沒有數據",
		firstText: "首頁",
		prevText: "上一頁",
		nextText: "下一頁",
		lastText: "尾頁"
	});
	Ext.define("Deppon.locale.zh_CN.ux.PageSizePlugin", {
		override: "Deppon.ux.PageSizePlugin",
		beforeText: "每頁顯示",
		afterText: "條記錄",
		limitWarning: "不能超過設定的最大分頁記錄數"
	});
	Ext.define("Deppon.locale.zh_CN.errorMessage.Window", {
		override: "Deppon.errorMessage.Window",
		title: "服務器異常",
		eTitle: "未知異常",
		eDetailTitle: "異常詳細信息"
	});
	Ext.define("Deppon.locale.zh_CN.errorMessage.Box", {
		override: "Deppon.errorMessage.Box",
		statics: {
			title: "系統提示",
			msg: "服務端連接異常",
			goLoginMsg: "會話失效，請重新登錄！"
		}
	});

	Ext.define("Deppon.locale.zh_CN.ux.FileUploadGrid", {
		override: "Deppon.ux.FileUploadGrid",
		statics: {
			file_name_header: "文件名",
			file_type_header: "類型",
			down_load_tip: "下載文件",
			preview_load_tip: "預覽圖片文件",
			upload_btn_text: "上傳",
			delete_btn_text: "刪除",
			warn_msgbox_title: "提示",
			warn_del_message: "你確定刪除此文件？",
			warn_notsel_message: "請至少選擇一個文件進行操作！",
			img_preview_title: "圖片預覽"
		}
	});
	Ext.define("Deppon.locale.zh_CN.ux.UploadDialog", {
		override: "Deppon.ux.UploadDialog",
		statics: {
			title: "文件上傳",
			state_col_title: "狀態",
			filename_col_title: "文件名",
			note_col_title: "備註",
			add_btn_text: "添加",
			remove_btn_text: "清除",
			remove_btn_tip: "清除未上傳成功的文件",
			upload_btn_start_text: "開始上傳",
			upload_btn_start_tip: "開始上傳",
			upload_btn_stop_text: "停止上傳",
			upload_btn_stop_tip: "停止上傳",
			error_msgbox_title: "錯誤信息",
			err_exceed_file_count: "超出文件隊列的上限！請選擇不大於{0}個文件",
			err_file_type_not_permitted: "錯誤的文件類型！請選擇符合以下擴展名的文件: {0}",
			note_queued_to_upload: "等待上傳",
			note_processing: "上傳中...",
			note_upload_failed: "上傳失敗",
			note_upload_success: "上傳成功",
			note_upload_error: "上傳出錯",
			note_aborted: "上傳中止",
			note_canceled: "取消"
		}
	});
});